package com.wteam.controller;

import com.wteam.PoJo.DTO.UserLoginDTO;
import com.wteam.PoJo.DTO.reflushloginDTO;
import com.wteam.PoJo.VO.UserLoginVO;
import com.wteam.Service.WeChatService;
import com.wteam.Service.WeChatService;
import com.wteam.framework.common.security.token.Token;
import com.wteam.until.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api( tags = "微信登录模块")
public class WeChatLoginController {
    @Autowired
    private WeChatService weChatService;

    @ApiOperation(value = "微信登录")
    @PostMapping("/user/user/login")
    public Result <UserLoginVO>WeChatlogin(@RequestBody UserLoginDTO userLoginDTO) {
        return  weChatService.login(userLoginDTO);
    }

    @ApiOperation(value = "刷新token")
    @PostMapping("/reflushlogin")
    public Result  <Token>reflushlogin(@RequestBody reflushloginDTO reflushloginDTO) {
        return  weChatService.reflushlogin(reflushloginDTO);
    }


}
